<?php
	define( "HOST" , 'localhost' );
	define( "DBNAME" , "scutter_f" );
	define( "DBPASS" , "rwhe08" );
	define( "DATABASE" , "scutter" );
	
	function sql_select($query){
		@ $con = mysql_connect(HOST,DBNAME,DBPASS) or die('无法连接数据库！' );
		mysql_select_db(DATABASE);
		$result = mysql_query($query);
		$i = 0;
		while($info[$i++] = mysql_fetch_array($result));
		unset($info[$i-1]);
		return $info;
	}
	
	if($_GET['cron']=='pk'){
		$k = 0;
		$query = "SELECT `jw_user`,`jw_pass` FROM `sina_jw2005` WHERE `is_pk`='1'";
		$result = sql_select($query);
		foreach($result as $row){
			$arr[$k++] = ' '.$row[0].':'.$row[1];
		}
		$query = "SELECT `jw_user`,`jw_pass` FROM `web_jw2005` WHERE `is_pk`='1'";
		$result = sql_select($query);
		foreach($result as $row){
			$arr[$k++] = ' '.$row[0].':'.$row[1];
		}
		$arr = array_flip(array_flip($arr));
		foreach($arr as $row){
			$infostring .= $row;
		}
		echo $infostring;
	}
	elseif($_GET['cron']=='ts'){
		$k = 0;
		$query = "SELECT `jw_user`,`jw_pass` FROM `sina_jw2005` WHERE `is_cron`='1'";
		$result = sql_select($query);
		foreach($result as $row){
			$arr[$k++] = ' '.$row[0].':'.$row[1];	
		}
		$query = "SELECT `jw_user`,`jw_pass` FROM `web_jw2005` WHERE `is_cron`='1'";
		$result = sql_select($query);
		foreach($result as $row){
			$arr[$k++] = ' '.$row[0].':'.$row[1];
		}
		$arr = array_flip(array_flip($arr));
		foreach($arr as $row){
			$infostring .= $row;
		}
		echo $infostring;
	}
?>